package cn.fr4nk.crawler.proxy;

import java.sql.Timestamp;

public class Proxy {

	private String ip;
	private int port;
	private final Timestamp createTime;
	private Timestamp lastUsedTime;
	private int failedTimes;
	
	public Proxy(String ip, int port) {
		this.ip = ip;
		this.port = port;
		createTime = new Timestamp(System.currentTimeMillis());
		lastUsedTime = null;
		failedTimes = 0;
	}
	
	public String getIpPort() {
		return this.ip+":"+this.port;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public int getPort() {
		return port;
	}

	public void setPort(int port) {
		this.port = port;
	}

	public Timestamp getLastUsedTime() {
		return lastUsedTime;
	}

	public void setLastUsedTime(Timestamp lastUsedTime) {
		this.lastUsedTime = lastUsedTime;
	}

	public int getFailedTimes() {
		return failedTimes;
	}

	public void setFailedTimes(int failedTimes) {
		this.failedTimes = failedTimes;
	}

	public Timestamp getCreateTime() {
		return createTime;
	}

}
